<?php
use  yii\helpers\Url;
use  yii\helpers\Html;
?>
	<main role="main">
		<?php echo $this->render('banner') ?>
    	<div class="container-lg mt-5 mb-3 list-wrap">
    		<div class="row">
    			<div class="col-md-3 col-12">
    				<div class="menu-second-wrap">
    					<i class="iconfont icon-playcircle-fill"></i>
    					<span class="parent-name"><?= Html::encode($menu->name)?></span>
						<?php if ($sub_menu) {?>
							<select name="" class="float-right" id="menu-second-select">
							<?php foreach ($sub_menu as $one => $first): ?>
								<option value=""><?= Html::encode($first['label'])?></option>
							<?php endforeach ?>
							</select>
						<?php }?>
    				</div>
					<?php if ($sub_menu) {?>
						<ul id="menu-second-list" class="list-group">
						<?php foreach ($sub_menu as $one => $first): ?>
							<?php if ($currentmenu->id == $first['id']) {?>
								<li class="list-group-item active"><i class="iconfont icon-double-arrow"></i><a href="<?= Url::to(['site/menu','menu_id'=>$currentmenu->id])?>"><?= Html::encode($first['label'])?></a></li>
							<?php }else {?>
								<li class="list-group-item"><i class="iconfont icon-double-arrow"></i><a href="<?= Url::to(['site/menu','menu_id'=>$first['id']])?>"><?= Html::encode($first['label'])?></a></li>
							<?php }?>
						<?php endforeach ?>
						</ul>
					<?php }?>
    			</div>
    			<div class="col-md-9">
    				<div class="content-wrap">
    					<div class="content-title border-bottom">
    						<span class="title-icon"></span>
    						<span class="ml-2 title-name"><?= Html::encode($currentmenu->name)?></span>
    						<div class="float-right">
    							<i class="iconfont icon-map"></i>
    							<nav aria-label="breadcrumb" class="d-inline-block">
    								<ol class="breadcrumb">
    									<li class="breadcrumb-item"><a href="/">网站首页</a></li>
										<?php if ($currentmenu->id == $menu->id) {?>
											<li class="breadcrumb-item breadcrumb-2 active"><a href="<?= Url::to(['site/menu','menu_id'=>$menu->id])?>"><?= Html::encode($menu->name)?></a></li>
										<?php }else {?>
											<li class="breadcrumb-item breadcrumb-2"><a href="<?= Url::to(['site/menu','menu_id'=>$menu->id])?>"><?= Html::encode($menu->name)?></a></li>
											<?php foreach ($sub_menu as $one => $first): ?>
												<?php if ($first['id'] == $currentmenu->id) {?>
													<li class="breadcrumb-item breadcrumb-3 active" aria-current="page"><a href="<?= Url::to(['site/menu','menu_id'=>$first['id']])?>"><?= Html::encode($first['label'])?></a></li>
												<?php }?>
											<?php endforeach ?>
										<?php }?>
    								</ol>
    							</nav>
    						</div>
    					</div>
    					<div class="content-list-wrap">
    						<ul id="content-list" class="list-group">
							<?php if ($data) {?>
								<?php foreach ($data as $one => $first): ?>
									<li class="list-group-item">
										<i class="iconfont icon-playcircle-fill"></i>
										<a href="<?= Url::to(['site/content','content_id'=>$first->id])?>"><?= Html::encode($first->title)?></a>
										<span class="float-right text-secondary"><?= Html::encode($first->create_time)?></span>
									</li>
								<?php endforeach ?>
                            <?php }?>
    						</ul>
                            <div class="pagination-wrap">
                                <?= \yii\widgets\LinkPager::widget([
                                    'pagination'=>$pagination,
                                    'linkOptions'=>['class'=>'page-link'],
                                    'linkContainerOptions'=>['class'=>'page-item'],
                                    'disabledListItemSubTagOptions'=>['class'=>'page-link']
                                ]);?>
                            </div>
    					</div>
    				</div>
    			</div>
    		</div>
    	</div>
		<?php echo $this->render('linksub') ?>			
    	
    </main>